#依然系第八章,
#2.)调试

#详细看 logging pdb.set_trace() 设置断点
print("调试.......")

def foo(s):
    n = int(s)
    assert n != 0, 'n is zero!' #如果 n!=0成立则输出 'n is zero!'
    return 10 / n

def main():
    foo('0')

#main();

import logging

logging.basicConfig(level=logging.INFO) #错误级别配置
'''
s = '0'
n = int(s)
logging.info('n = %d' % n)
print(10 / n)
'''

import pdb

s = '0'
n = int(s)
pdb.set_trace()
print("pdb.set_trace test")